home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Pipes / PipePacket.h < prev    next >
Encoding:
Text File  |  1998-06-16  |  727 b   |  41 lines  |  [TEXT/CWIE]

  1. // PipePacket.h
  2.  
  3. #ifndef PipePacket_h
  4. #define PipePacket_h
  5.  
  6. #ifndef Integers_h
  7. #include "Integers.h"
  8. #endif
  9.  
  10. class PipePacket
  11.   {
  12.     private:
  13.         uint32 data;
  14.         bool flushing;
  15.     
  16.     public:
  17.         enum Flush { flush };
  18.  
  19.         PipePacket()             : data( 0 ), flushing( false )    {}
  20.         PipePacket( Flush )    : data( 0 ), flushing( true )        {}
  21.         
  22.         explicit PipePacket( uint32 theData )
  23.           : data( theData ), flushing( false )
  24.           {}
  25.         
  26.         uint32 DataSize() const                { return data; }
  27.         bool Flushing() const                { return flushing; }
  28.         
  29.         bool IsZero() const;
  30.  
  31.         void operator+=( PipePacket );
  32.         void operator-=( PipePacket );
  33.         
  34.         void LimitTo( PipePacket );
  35.         
  36.         void LimitData( uint32 limit );
  37.         void ClearFlush()                        { flushing = false; }
  38.   };
  39.  
  40. #endif
  41.